package com.xyzwps.webfluxjava.common.webFilter;

import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;

import lombok.val;
import reactor.core.publisher.Mono;

@Component
@Order(0)
public class LogFilter implements WebFilter {

    @Override
    public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
        val mono = chain.filter(exchange).log("ddd: " + System.currentTimeMillis());
        return mono;
    }
}